home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / exechk.com / EXECHK.DOC < prev    next >
Encoding:
Text File  |  1990-12-07  |  6.0 KB  |  139 lines

  1. (*******************************************************************
  2. [76576,470]
  3. EXECHK.ZIP/binary             6-Dec-90 xxxx               Accesses: xx
  4.  
  5.     Title   : Copy discouragement
  6.     Keywords: APPLICATION COPY EXE FILE ILLEGAL PROTECT SOFTWARE SOURCE STAMP
  7.  
  8. Source code illustrates a method of "stamping" your original
  9. application EXE file with the user's name, address, serial #,
  10. etc., in order to discourage illegal copying of your software.
  11. This method works with files compressed using LZEXE and will
  12. compile under any version of TP.  Includes sample application
  13. and installation programs.
  14. *******************************************************************)
  15.  
  16. (*******************************************************************
  17. PURPOSE
  18. -------
  19. To discourage illegal copying of software, by "stamping" the user's
  20. Name, Serial#, etc. onto the EXE file itself.  (Actually it is appended
  21. to the end of the EXE file.)
  22.  
  23. DIRECTIONS FOR USE
  24. ------------------
  25. After compiling both files (MYPROG.PAS and MYINSTAL.PAS), try to
  26. run them.  MYPROG.EXE will not run until it has been modified by
  27. MYINSTAL.EXE, and the MYINSTAL.EXE will only run from the A: drive.
  28.  
  29. Copy both EXE files to a diskette in A: drive, then run "a:myinstal".
  30. You will be prompted for your name, company, city/state and software
  31. serial number, which will be written to the MYPROG.EXE file on the
  32. A: drive.  Now the MYPROG.EXE will run (from any drive), displaying
  33. the user/licensee data on startup.
  34.  
  35. WARNING!
  36. --------
  37. You must reset the "FileMode" variable to ReadWrite, as the EXECHK
  38. routine sets the "FileMode" variable to ReadOnly under DOS 2.x and
  39. to Read_DenyNone under DOS 3.x.  If you encounter a failure in your
  40. programs when writing to a file, then this is most likely the cause.
  41.  
  42. This is done for you in the demo programs.
  43.  
  44. NOTES
  45. -----
  46. Checks the EXE file header (see the "exechk.def" file) and compares
  47. it to the actual "FileSize", during program initialization.
  48. Will work correctly even if the EXE file has been LZEXE'd.
  49.  
  50. The "ExeInstallData" and "ExeReadData" routines are not specific
  51. to the data types used in "mydata.inc"; they use a VAR parameter so
  52. you can create your own.  You do have to specify the size of the
  53. variables which you're using, however.
  54.  
  55. If you had just a one line "stamp" string, you would call either
  56. routine like this:
  57.  
  58. VAR
  59.    MyDataStruc               : string ;
  60. begin
  61.    Exe....Data ( MyFileName , MyDataStruc , SizeOf ( MyDataStruc ) ) ;
  62. end .
  63.  
  64. Since the user-specific information is only appended the the EXE file,
  65. it could, of course, be altered by a savvy user through Norton Utils,
  66. PC-Tools, etc.  If this is a concern, you could add an encryption routine
  67. and cross-check the data structure, without having to rework the
  68. main routines.
  69.  
  70. PROGRAM LOGIC - The First "INSTALL"
  71. -----------------------------------
  72. If "IsExePersonalized" returns FALSE, get the user information
  73. ("MyDataInput") and call the "ExeInstallData" routine to append
  74. the information to the original EXE file, presumably on drive A:
  75.  
  76. PROGRAM LOGIC - Subsequent "INSTALLS"
  77. -------------------------------------
  78. Since the user may have to re-install the program (due to disk problems,
  79. purchase of a new machine, inadvertant format/erasure, etc.), if
  80. the "IsExePersonalized" returns TRUE, then skip the "MyDataInput"
  81. and go directly to your main installation.
  82.  
  83. PROGRAM LOGIC - The actual application software
  84. -----------------------------------------------
  85. If function "IsExePersonalized" returns FALSE, then the program should
  86. HALT, because it has not yet been "stamped".  Of course, it would be
  87. polite to inform the user that he must have the original disk and
  88. should install it properly.
  89. *******************************************************************)
  90.  
  91.          ----------------end-of-author's-documentation---------------
  92.  
  93.                          Software Library Information:
  94.  
  95.                     This disk copy provided as a service of
  96.  
  97.                            Public (software) Library
  98.  
  99.          We are not the authors of this program, nor are we associated
  100.          with the author in any way other than as a distributor of the
  101.          program in accordance with the author's terms of distribution.
  102.  
  103.          Please direct shareware payments and specific questions about
  104.          this program to the author of the program, whose name appears
  105.          elsewhere in  this documentation. If you have trouble getting
  106.          in touch with the author,  we will do whatever we can to help
  107.          you with your questions. All programs have been tested and do
  108.          run.  To report problems,  please use the form that is in the
  109.          file PROBLEM.DOC on many of our disks or in other written for-
  110.          mat with screen printouts, if possible.  PsL cannot debug pro-
  111.          programs over the telephone, though we can answer questions.
  112.  
  113.          Disks in the PsL are updated  monthly,  so if you did not get
  114.          this disk directly from the PsL, you should be aware that the
  115.          files in this set may no longer be the current versions. Also,
  116.          if you got this disk from another vendor and are having prob-
  117.          lems,  be aware that  some files may have become corrupted or
  118.          lost by that vendor. Get a current, working disk from PsL.
  119.  
  120.          For a copy of the latest monthly software library newsletter
  121.          and a list of the 2,000+ disks in the library, call or write
  122.  
  123.                            Public (software) Library
  124.                                P.O.Box 35705 - F
  125.                             Houston, TX 77235-5705
  126.  
  127.                                  Orders only:
  128.                                 1-800-2424-PSL
  129.                               MC/Visa/AmEx/Discover
  130.  
  131.                           Outside of U.S. or in Texas
  132.                           or for general information,
  133.                               Call 1-713-524-6394
  134.  
  135.                           PsL also has an outstanding
  136.                           catalog for the Macintosh.
  137.  
  138.  
  139.